#include "NotificationManager.h"

class PlainTextNotificationComposer : public NotificationComposer
{
public:
    virtual void Header()
    {
        m_stringStream << "================================================================" << std::endl;
        m_stringStream << "==Notification Generated Automatically from News Monitoring ====" << std::endl;
        m_stringStream << "================================================================" << std::endl;
    }

    virtual void MetaData( const std::string& name, const std::string& value )
    {
        m_stringStream << "===MetaData: [" << name << "]=[" << value << "]" << std::endl;
    }

    virtual void Footer()
    {
        m_stringStream << "================================================================" << std::endl;
        m_stringStream << "==Any query or change request please contact News Monitoring team" << std::endl;
        m_stringStream << "==Shuo.li kurt.wei xihui.he " << std::endl;
        m_stringStream << "================================================================" << std::endl;
    }

    virtual void NewSection( const std::string& name )
    {
        m_stringStream << std::endl;
        m_stringStream << "========" << name << std::endl;
    }

    virtual void EndSection()
    {
        m_stringStream << "========" << std::endl;
    }

    virtual void AppendMessage( const int errLevel, const std::string& message )
    {
        m_stringStream << "ErrLevel:[" << errLevel << "]:[" << message << "]" << std::endl;
    }

    virtual void Reset()
    {
        NotificationComposer::Reset();
        m_stringStream.str("");
    }

    virtual void Stream( std::ostream& out ) const
    {
        out << m_stringStream.str();
    }

private:
    std::stringstream  m_stringStream;

};